package com.superyee.commonlib.http;


import com.superyee.commonlib.logic.BaseLogic;

/**
 * 网络请求返回实体
 */
public class HttpResponse {

    public HttpResponse() {

    }

    public HttpResponse(int code, String result) {
        this.resultCode = code;
        this.result = result;
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    private int resultCode;
    private String result;

    public String getMsg() {
        return BaseLogic.getMsg(result);
    }

    public boolean isSuccess() {
        return BaseLogic.SUCCESS_CODE == resultCode;
    }

    @Override
    public String toString() {
        return "[" + resultCode + "]" + result;
    }
}
